fix(picker): no abortar el catálogo remoto al re-renderizar constraints - #253
Merged
Merged
Conversation
El explorer remoto dependía de la identidad del objeto constraints. Cualquier re-render del padre (p. ej. el preview del Video Editor en reproducción) abortaba la petición y el picker se quedaba en loading. Co-authored-by: ignaciodelcano+dcl <ignaciodelcano+dcl@gmail.com>
PR Review — Loreframe StudioRisk: low Automated review from Findings
Changed files
CONTRIBUTING checklist
Posted by the repo PR review workflow. Re-runs on each push to the PR. |
IAnMove
marked this pull request as ready for review
September 7, 2026 21:21
Author
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_7c030977-1474-4448-94e7-37afce7eccc1) |
Code healthQuality score: 54.7/100Higher is better. The score is a trend dashboard; the independent ratchet below remains the CI gate.
Change vs PR base: +0.0 points.
Markdown, JSON catalogs and tests are out of this table. Only Most complex functions
Trend vs baseline
Warnings
Ratchet passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumen ejecutivo
Qué cambia
El catálogo remoto del explorer deja de relanzar (y abortar) la petición cada vez que el padre recrea el objeto
constraintscon el mismo filtro.Para qué sirve
Si el preview del Video Editor (u otro padre) se re-renderiza mientras From HocusPocus está abierto —por ejemplo con el vídeo en reproducción— el picker ya no se queda en loading infinito.
Impacto para el usuario
From HocusPocus / explorer compartido carga la página de vídeos aunque el montaje siga reproduciéndose detrás del modal.
Riesgo
Estado
Summary
useRemoteCatalogPagerefetching depended onconstraintsobject identity. VideoEditorPanel (PR 251) and other callers pass an inline{ kinds, maxCount, optional }object, so any parent rerender aborted the in-flight/api/v1/assetsrequest. With the preview playing,onTimeUpdatererenders often enough that the explorer never reachedready.The effect now keys on a stable kinds string (
remoteCatalogFilterKey) instead of the constraints object. Pagination, search, workspace and kind changes still refetch.Overview
Open From HocusPocus (or any remote AssetExplorerDialog) while the parent keeps rerendering. The first catalog request completes; rebuilding the same constraints object does not start a second request. Changing page, search, workspace or kinds still fetches again.
Detailed changes
Backend
None.
UI and Wizard
remoteCatalog.ts:remoteCatalogFilterKey+ effect deps use the kinds string.Data, provenance and compatibility
No draft or catalog schema change.
Files and ownership
ui/src/features/asset-picker/remoteCatalog.tsui/tests/remoteCatalog.test.tsui/tests/assetExplorerRemote.test.tsxLeft untouched: VideoEditorPanel (inline constraints is safe once the hook ignores identity), Studio pickers, backend assets router.
Validation
Date (UTC): 2026-09-07
Base SHA: bd1b3bc
Head SHA: 6a48a30
Validation scope: focused
python scripts/verify_clean_repo.pypython -m compileall -q app/services app/launch.py scriptsFocused Python tests: N/A
cd ui && npm run i18n:checkUI tests:
npx tsx --tsconfig tsconfig.app.json --import ./tests/setupI18n.ts --test tests/remoteCatalog.test.ts tests/assetExplorerRemote.test.tsx— 11/11 passcd ui && npm run lint -- --max-warnings=0cd ui && npm run buildgit diff --checkE2E/smoke checks: N/A (picker contract; no GPU)
Code quality
main: pending CICI and review
Coste de la tarea
Notes and limitations
Found while reviewing PR 251 (shared catalog picker in Video Editor). The hook bug already affects every remote explorer that passes an inline
constraintsobject.Follow-up work
None.
Checklist
Note
Low Risk
Narrow React hook dependency change in the asset picker; no API, auth, or data-model changes.
Overview
Fixes infinite loading in the remote asset explorer when a parent re-renders often (e.g. video preview
onTimeUpdate) while passing a fresh inlineconstraintsobject with the samekinds.useRemoteCatalogPagenow depends on a stableremoteCatalogFilterKey(selectedkindor joinedconstraints.kinds) instead of the wholeconstraintsreference, so equivalent filters no longer restart the catalog request and mark the in-flight response stale. Pagination, search, workspace, sort, retry, and real kind changes still trigger a fetch.Unit tests cover key stability; an integration test asserts
AssetExplorerDialogdoes not call/api/v1/assetsagain after a rerender with equivalent constraints.Reviewed by Cursor Bugbot for commit 6a48a30. Configure here.